﻿using Avalonia.Controls;
using Avalonia;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FantomNext.Helpers
{
    public static class CanvasHelper
    {
        public static void SetPos(AvaloniaObject control, double x, double y)
        {
            Canvas.SetLeft(control, x);
            Canvas.SetTop(control, y);
        }
        public static void SetPosCenter(Control control, double x, double y)
        {
            Canvas.SetLeft(control, x - control.Bounds.Width / 2);
            Canvas.SetTop(control, y - control.Bounds.Height / 2);
        }
        public static void SetPosCenter(Control control, Point point)
        {
            Canvas.SetLeft(control, point.X - control.Bounds.Width / 2);
            Canvas.SetTop(control, point.Y - control.Bounds.Height / 2);
        }
    }
}
